<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>dom-获取(框架)</title>
  </head>
  <body>
    <div class="box1">
      <p id="mp">这是一段文字</p>
      <p class="cls">这是一段文字</p>
      <p class="cls">这是一段文字</p>
    </div>

    <div class="box2">
      <p>这是一段文字</p>
      <p name="pp">这是一段文字</p>
      <p class="cls">这是一段文字</p>
      <p name="pp">这是一段文字</p>
    </div>

    <script
      src="https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/jquery/3.6.0/jquery.min.js"
      type="application/javascript"
    ></script>
    <script>
      /* 
        获取元素
        $('选择器')
        例如:
        $(p)
        $('#mp')
        $('.cls')
        $('.box1 .cls')
      */
      console.log($('.box1 .cls'))
    </script>
  </body>
</html>
